-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for trait clause bounds #11
Conversation
Rather than having a hidden invariant, the translation from LLBC to krml's internal AST now repeats the const generic binders within expression binders too -- this aligns with what krml does. This change also introduces a new kind of binder, which will act as a stand-in for additional function parameters intended to hold trait clause methods.
… better, add more things to the blocklist to get unblocked
@@ -172,6 +213,25 @@ module RustNames = struct | |||
let from = | |||
parse_pattern "core::convert::From<@T, @U>::from" | |||
|
|||
let into_u16 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@W95Psp I heard from @sonmarcho that there is a better, more concise way to do this, so this would be another interesting mini-task to add onto this PR -- refactor this bit to have more effective matching logic here, and in the main expression translation function
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…' into protz_trait_clauses
@@ -172,6 +213,25 @@ module RustNames = struct | |||
let from = | |||
parse_pattern "core::convert::From<@T, @U>::from" | |||
|
|||
let into_u16 = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -868,16 +1181,30 @@ let rec expression_of_raw_statement (env: env) (ret_var: C.var_id) (s: C.raw_sta | |||
Krml.Helpers.with_unit K.(EAssign (dest, maybe_addrof env ty (with_type t (EBufRead (e1, e2))))) | |||
|
|||
| Call { func = FnOpRegular fn_ptr; args; dest; _ } | |||
when false && Charon.NameMatcher.match_fn_ptr env.name_ctx RustNames.config RustNames.from fn_ptr -> | |||
when ( | |||
Charon.NameMatcher.match_fn_ptr env.name_ctx RustNames.config RustNames.from_u16 fn_ptr || |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Created #20 as a followup
else if matches RustNames.from_i16 then Int16 | ||
else if matches RustNames.from_i32 then Int32 | ||
else if matches RustNames.from_i64 then Int64 | ||
if matches RustNames.from_u16 || matches RustNames.into_u16 then UInt16 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same remark as above
…dice into protz_trait_clauses
…d still have the same signature -- add dummy cg parameters
…hecking and support for strings
…mensional arrays on the stack, and as top-level constants. This fixes #15
I'm merging this and opened #20 to track the specific issue of improving the name matcher logic. |
This isn't quite working yet but I want to get this in place to start working through the code with @W95Psp.This is now on-par with what used to work before.
Let's try to block some time to go over this once you've had a chance to browse the list of changes. I've tried to add comments whenever I could, so hopefully some of this makes sense? Thanks!!